/*
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Copyright (c) 2024, Arm Limited. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 * - Redistributions of source code must retain the above copyright notice, this
 *   list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright notice, this
 *    list of conditions and the following disclaimer in the documentation and/or
 *    other materials provided with the distribution.
 * - Neither the name of ARM nor the names of its contributors may be used to
 *    endorse or promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#ifndef __ACAMERA_FIRMWARE_CONFIG_H__
#define __ACAMERA_FIRMWARE_CONFIG_H__

#include "platform_base_address.h"

/* Autogenerated firmware settings. */
#define ACAMERA_EVENT_QUEUE_SIZE                     256
#define ACAMERA_FW_SHP_DETECTED_MAXIMUM              1023
#define ACAMERA_IRQ_AE_STATS                         3
#define ACAMERA_IRQ_AF2_STATS                        1
#define ACAMERA_IRQ_ANTIFOG_HIST                     14
#define ACAMERA_IRQ_AWB_STATS                        4
#define ACAMERA_IRQ_DFE_FRAME_END                    17
#define ACAMERA_IRQ_FRAME_END                        0
#define ACAMERA_IRQ_FRAME_START                      7
#define ACAMERA_IRQ_FRAME_WRITER_DS                  6
#define ACAMERA_IRQ_FRAME_WRITER_FR                  5
#define ACAMERA_ISP_PROFILING                        0
#define ACAMERA_ISP_PROFILING_INIT                   0
#define AE_CENTER_ZONES                              65535
#define AF_SPOT_COUNT_X                              5
#define AF_SPOT_COUNT_Y                              5
#define ANALOG_GAIN_ACCURACY                         ( 1 << ( LOG2_GAIN_SHIFT - 2 ) )
#define AWB_BG_MAX_GAIN                              0
#define BLACK_LEVEL_SHIFT_DG                         8
#define BLACK_LEVEL_SHIFT_WB                         8
#define CALIBRATION_IRIDIX_AVG_COEF_INIT             0
#define CM_SATURATION_TARGET                         128
#define CONNECTION_BUFFER_SIZE                       ( 26 * 1024 )
#define CONNECTION_IN_THREAD                         1
#define DMA_WRITER_DEFAULT_BUFFER_NO                 4
#define EXPOSURE_DRIVES_LONG_INTEGRATION_TIME        0
#define FILTER_LONG_INT_TIME                         0
#define FILTER_SHORT_INT_TIME                        0
#define FIRMWARE_CONTEXT_NUMBER                      1
#define FPGA_HAS_HDMI                                0
#define FSM_NAMES                                                                                                  \
    {                                                                                                              \
        "GENERIC", "SENSOR", "CMOS", "GENERAL", "AE_ACAMERA", "AWB_ACAMERA", "AF_ACAMERA", "COLOR_MATRIX",         \
        "PURPLE_FRINGE", "IRIDIX_ACAMERA", "NOISE_REDUCTION", "CROP", "SHARPENING", "MATRIX_YUV", "GAMMA_ACAMERA", \
        "DMA_WRITER", "MONITOR"                                                                                    \
    }
#define FW_ALG_SUPPORT_SHARED_LIB                    0
#define FW_DO_INITIALIZATION                         1
#define FW_DS1_OUTPUT_FORMAT_PIPE                    PIPE_OUT_RGB
#define FW_EVT_QUEUE_TIMEOUT_MS                      100
#define FW_FR_OUTPUT_FORMAT_PIPE                     PIPE_OUT_RGB
#define FW_HAS_CONTROL_CHANNEL                       0
#define FW_HAS_CUSTOM_SETTINGS                       1
#define FW_INPUT_FORMAT                              DMA_FORMAT_RAW12
#define FW_LOG_FROM_ISR                              0
#define FW_LOG_HAS_SRC                               0
#define FW_LOG_HAS_TIME                              1
#define FW_LOG_LEVEL                                 LOG_NOTICE
#define FW_LOG_MASK                                  4294967295
#define FW_LOG_REAL_TIME                             0
#define FW_OUTPUT_FORMAT                             DMA_FORMAT_A2R10G10B10
#define FW_OUTPUT_FORMAT_SECONDARY                   DMA_FORMAT_DISABLE
#define FW_USE_SYSTEM_DMA                            0
#define FW_ZONE_AE                                   0
#define HDMI_TDA19988                                1
#define IRIDIX_BYPASS_MAX_STR_CLIP                   0
#define IRIDIX_HAS_PRE_POST_GAMMA_LUT_LINEAR         0
#define IRIDIX_STRENGTH_BY_EXP_RATIO                 0
#define IRIDIX_STRENGTH_TARGET                       128
#define ISP_BINARY_SEQUENCE                          0
#define ISP_CONTROLS_DMA_READER                      1
#define ISP_DEFAULT_AF_ZONES_HOR                     15
#define ISP_DEFAULT_AF_ZONES_VERT                    15
#define ISP_DISPLAY_MODE                             1080
#define ISP_DMA_RAW_CAPTURE                          0
#define ISP_FULL_HISTOGRAM_SIZE                      1024
#define ISP_FW_BUILD                                 1
#define ISP_GAMMA_LUT_SIZE                           129
#define ISP_HAS_AE_ACAMERA_FSM                       1
#define ISP_HAS_AF                                   1
#define ISP_HAS_AF_ACAMERA_FSM                       1
#define ISP_HAS_AWB_ACAMERA_FSM                      1
#define ISP_HAS_CMOS_FSM                             1
#define ISP_HAS_COLOR_MATRIX_FSM                     1
#define ISP_HAS_CONNECTION_BUFFER                    0
#define ISP_HAS_CONNECTION_CHARDEV                   0
#define ISP_HAS_CONNECTION_DEBUG                     0
#define ISP_HAS_CONNECTION_SOCKET                    0
#define ISP_HAS_CONNECTION_SOCKET_PORT               0
#define ISP_HAS_CONNECTION_UART                      1
#define ISP_HAS_CROP_FSM                             1
#define ISP_HAS_DMA_WRITER_FSM                       1
#define ISP_HAS_DS1                                  1
#define ISP_HAS_FPGA_WRAPPER                         0
#define ISP_HAS_GAMMA_ACAMERA_FSM                    1
#define ISP_HAS_GENERAL_FSM                          1
#define ISP_HAS_IRIDIX_ACAMERA_FSM                   1
#define ISP_HAS_MATRIX_YUV_FSM                       1
#define ISP_HAS_META_CB                              0
#define ISP_HAS_MONITOR_FSM                          1
#define ISP_HAS_NOISE_REDUCTION_FSM                  1
#define ISP_HAS_PURPLE_FRINGE_FSM                    1
#define ISP_HAS_RAW_CB                               0
#define ISP_HAS_SENSOR_FSM                           1
#define ISP_HAS_SHARPENING_FSM                       1
#define ISP_HAS_WDR_FRAME_BUFFER                     0
#define ISP_HW_IS_MALI_C32_C52                       0
#define ISP_INPUT_BITS                               20
#define ISP_IRQ_DISABLE_ALL_IRQ                      4294967295
#define ISP_IRQ_MASK_VECTOR                          4289200114
#define ISP_MAX_CALIBRATION_DATA_SIZE                ( 128 * 1024 )
#define ISP_MAX_SENSOR_MODES                         16
#define ISP_SENSOR_DRIVER_AD5821                     0
#define ISP_SENSOR_DRIVER_AN41908A                   0
#define ISP_SENSOR_DRIVER_BU64295                    0
#define ISP_SENSOR_DRIVER_BU64748                    0
#define ISP_SENSOR_DRIVER_DONGWOON                   0
#define ISP_SENSOR_DRIVER_DW9800                     0
#define ISP_SENSOR_DRIVER_FP5510A                    0
#define ISP_SENSOR_DRIVER_LC898201                   0
#define ISP_SENSOR_DRIVER_MODEL                      0
#define ISP_SENSOR_DRIVER_NULL                       1
#define ISP_SENSOR_DRIVER_ROHM                       0
#define ISP_SENSOR_DRIVER_V4L2                       0
#define ISP_SOC_DMA_BUS_OFFSET                       0
#define ISP_SOC_START_ADDR                           ISP_BASE_NS
#define ISP_VCLK_FREQ_MHZ                            100
#define ISP_WDR_DEFAULT_MODE                         WDR_MODE_LINEAR
#define ISP_WDR_SWITCH                               1
#define KERNEL_MODULE                                0
#define LOG2_GAIN_SHIFT                              18
#define LOG_MODULE_AE_ACAMERA                        4
#define LOG_MODULE_AE_ACAMERA_MASK                   16
#define LOG_MODULE_AF_ACAMERA                        6
#define LOG_MODULE_AF_ACAMERA_MASK                   64
#define LOG_MODULE_ALL                               131071
#define LOG_MODULE_AWB_ACAMERA                       5
#define LOG_MODULE_AWB_ACAMERA_MASK                  32
#define LOG_MODULE_CMOS                              2
#define LOG_MODULE_CMOS_MASK                         4
#define LOG_MODULE_COLOR_MATRIX                      7
#define LOG_MODULE_COLOR_MATRIX_MASK                 128
#define LOG_MODULE_CROP                              11
#define LOG_MODULE_CROP_MASK                         2048
#define LOG_MODULE_DMA_WRITER                        15
#define LOG_MODULE_DMA_WRITER_MASK                   32768
#define LOG_MODULE_GAMMA_ACAMERA                     14
#define LOG_MODULE_GAMMA_ACAMERA_MASK                16384
#define LOG_MODULE_GENERAL                           3
#define LOG_MODULE_GENERAL_MASK                      8
#define LOG_MODULE_GENERIC                           0
#define LOG_MODULE_GENERIC_MASK                      1
#define LOG_MODULE_IRIDIX_ACAMERA                    9
#define LOG_MODULE_IRIDIX_ACAMERA_MASK               512
#define LOG_MODULE_MATRIX_YUV                        13
#define LOG_MODULE_MATRIX_YUV_MASK                   8192
#define LOG_MODULE_MAX                               17
#define LOG_MODULE_MONITOR                           16
#define LOG_MODULE_MONITOR_MASK                      65536
#define LOG_MODULE_NOISE_REDUCTION                   10
#define LOG_MODULE_NOISE_REDUCTION_MASK              1024
#define LOG_MODULE_PURPLE_FRINGE                     8
#define LOG_MODULE_PURPLE_FRINGE_MASK                256
#define LOG_MODULE_SENSOR                            1
#define LOG_MODULE_SENSOR_MASK                       2
#define LOG_MODULE_SHARPENING                        12
#define LOG_MODULE_SHARPENING_MASK                   4096
#define MAX_REG_TRACK_ENTRIES                        600
#define OVEREXPOSE_TO_KEEP_ANTIFLICKER               0
#define SENSOR_BINARY_SEQUENCE                       0
#define SENSOR_DEFAULT_EXP_NUM                       1
#define SENSOR_DEFAULT_PRESET_MODE                   0
#define SENSOR_HAS_FLASH                             0
#define SENSOR_HW_INTERFACE                          ACameraDefault
#define SENSOR_MASTER_CLOCK                          27
#define SENSOR_SUPPORT_OTP                           0
#define SYSTEM_AE_COMPENSATION_DEFAULT               128
#define SYSTEM_ANTI_FLICKER_FREQUENCY_DEFAULT        50
#define SYSTEM_EXPOSURE_PARTITION_VALUE_COUNT        10
#define SYSTEM_EXPOSURE_RATIO_DEFAULT                8
#define SYSTEM_MANUAL_EXPOSURE_RATIO_DEFAULT         0
#define SYSTEM_MAXIMUM_IRIDIX_STRENGTH_DEFAULT       255
#define SYSTEM_MINIMUM_IRIDIX_STRENGTH_DEFAULT       0
#define USER_MODULE                                  0
#define V4L2_INTERFACE_BUILD                         0
#define V4L2_SOC_SUBDEV_ENABLE                       0

/* Autogenerated ISP core settings. DO NOT EDIT. */
#define ISP_CORE_ID                                  0x58F8E91F
#define ISP_CONFIG_PING                              1
#define ISP_CONFIG_PONG                              0
#define ISP_CONFIG_LUT_OFFSET                        0x054A8
#define ISP_CONFIG_PING_OFFSET                       0x18E88
#define ISP_CONFIG_PING_SIZE                         0x17FC0
#define ISP_METERING_ZONES_MAX_V                     15
#define ISP_METERING_ZONES_MAX_H                     15
#define ISP_METERING_OFFSET_AWB                      464
#define ISP_METERING_OFFSET_AF                       928
#define ISP_INTERRUPT_EVENT_NONES_COUNT              16
#define ISP_INTERRUPT_EVENT_ISP_START_FRAME_START    0
#define ISP_INTERRUPT_EVENT_ISP_END_FRAME_END        1
#define ISP_INTERRUPT_EVENT_METERING_AF              4
#define ISP_INTERRUPT_EVENT_METERING_AEXP            5
#define ISP_INTERRUPT_EVENT_METERING_AWB             6
#define ISP_INTERRUPT_EVENT_ANTIFOG_HIST             8
#define ISP_INTERRUPT_EVENT_BROKEN_FRAME             3
#define ISP_INTERRUPT_EVENT_MULTICTX_ERROR           2
#define ISP_INTERRUPT_EVENT_DMA_ERROR                22
#define ISP_INTERRUPT_EVENT_WATCHDOG_EXP             19
#define ISP_INTERRUPT_EVENT_FRAME_COLLISION          20

#endif /* __ACAMERA_FIRMWARE_CONFIG_H__*/
